import request from './request'

export class MailApi {
  static getMails(params): Promise<[IMail[], number]> {
    return request.get('/smtp', { params })
  }
  static deleteMail(id): Promise<IMail> {
    return request.delete(`/smtp/${id}`)
  }
  static testSendMail(user): Promise<IFile> {
    return request.post('/smtp', {
      to: user,
      subject: '测试',
      text: "测试邮件"
    })
  }
}